

def transfer_target_status(data_list, data_type):
    if data_list:
        for data in data_list:
            if isinstance(data[f'{data_type}_status'], bool):
                data[f'{data_type}_status'] = 1 if data[f'{data_type}_status'] else 0

def transfer_menu_flag(menus, keys=None):
    if menus:
        for menu in menus:
            if "bind_columns" in menu:
                transfer_target_status(menu['bind_columns'], "column")
            if "summary_opts" in menu:
                transfer_target_status(menu['summary_opts'], 'opt')
            if 'children' in menu:
                transfer_menu_flag(menu['children'], keys)

